﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Windows.Storage;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace IndustrialSmokeCalc
{
    public partial class InputMeasurement : PhoneApplicationPage
    {
        public InputMeasurement()
        {
            InitializeComponent();
        }

        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            if (txtMinute.Text.Contains(","))
            {
                MessageBox.Show("Input hanya berupa angka!", "Peringatan", MessageBoxButton.OK);
            }
            //else if (int.Parse(txtMinute.Text.ToString()) < 20 || int.Parse(txtMinute.Text.ToString()) > 36)
            //{
            //    MessageBox.Show("Lama pengamatan antara 20-36 menit!", "Peringatan", MessageBoxButton.OK);
            //}
            else
            {
                DataSingleton.Instance.MinuteMeasurement = int.Parse(txtMinute.Text.ToString());
                DataSingleton.Instance.SecondMeasurement = int.Parse(listSecond.SelectedValue.ToString());
                int x = DataSingleton.Instance.MinuteMeasurement;
                int y = DataSingleton.Instance.SecondMeasurement;
                DataSingleton.Instance.MeasurementResult = new int[x, y];
                NavigationService.Navigate(new Uri("/Camera.xaml", UriKind.Relative));
            }
        }
    }
}